export function printPage(_window) {
    if (!!window.ActiveXObject || "ActiveXObject" in _window) { //是否ie
        removeIeHeaderAndFooter();
    }
    _window.print();
}

export function removeIeHeaderAndFooter() {
    var hkey_path;
    hkey_path = "HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
    try {
        // eslint-disable-next-line no-undef
        var RegWsh = new ActiveXObject("WScript.Shell");
        RegWsh.RegWrite(hkey_path + "header", "");
        RegWsh.RegWrite(hkey_path + "footer", "");
    } catch (e) {
        console.log(e)
    }
}
